<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ include file="header.jsp"%>
<div class="flex-container">
<%@ include file="leftmenu.jsp"%>
			<div class="right-container">
			    <div class="right_content">
			    	<div class="header">
			    		<img src="images_c/location.png" />
			    		<h6>首页<span class="relation_symbol">></span>创客管理<span class="relation_symbol">></span><span class="relation_color">创客实名审核</span></h6>
			    	</div>
			    	<ul class="row tab_block" style="display:none" id="tab1">
			    		<li class="active_li">企业实名认证审核</li>
			    		<li>个人实名认证审核</li>
			    	</ul>
			    	<ul class="row tab_block" style="display:none" id="tab2">
			    		<li>企业实名认证审核</li>
			    		<li class="active_li">个人实名认证审核</li>
			    	</ul>
			    	
			    	
			    	<div class="tab_content" id="tab_content_enterprise">
			    		<form id="queryOptionsQy" enctype="multipart/form-data" action="authentication/infoCheck" method="POST">
			    		
				    		<div class="row search_block">
				    			<input type="text" id="type" name="type" value="qy" hidden="true"/>
				    		
			    				<label class="search_name">用户名</label>
			    				<input class="col-md-2 search_box" type="text" id="queryusername" name="username" value="${authenticationBeanQy.username}"/>
			    				
			    				<label class="search_name">企业法人</label>
			    				<input class="col-md-2 search_box" type="text" id="queryzname" name="zname" value="${authenticationBeanQy.zname}"/>
			    				
			    				<label class="search_name">审核状态</label>
			    				<select style="width:100px;" class="col-md-1 select_box" id="status" name="status"/>
									<option value="999" ${authenticationBeanQy.status == 999?'selected':''}>请选择</option>
									<option value="0" ${authenticationBeanQy.status == 0?'selected':''}>未审核</option>
									<option value="1" ${authenticationBeanQy.status == 1?'selected':''}>未通过</option>
									<option value="2" ${authenticationBeanQy.status == 2?'selected':''}>通过</option>
								</select>
			    				
			    				<div class="form_group">
									<label></label>
									<a class="search_btn" href="javascript:submit()">查询</a>
								</div>
					    	</div>
				    	</form>
				    	<div class="row table_container">
				    		<div class="row search_result">
				    			<div class="search_result_left">
				    				<div class="search_result_icon"></div>
				    			    <p class="search_result_label">查询结果</p>
				    			</div>
				    			<div class="search_result_right">
				    				<img src="images_c/icon1.png" />
				    				<span>审核通过</span>
				    				<img src="images_c/icon2.png" />
				    				<span>审核不通过</span>
				    				<img src="images_c/icon3.png" />
				    				<span>启用</span>
				    				<img src="images_c/icon4.png" />
				    				<span>停用</span>
				    			</div>
				    		</div>
				    		<div class="table_block">
					    		<table class="table table-center table-striped table-bordered table-hover"
								cellspacing="0" width="100%">
					    			<thead>
					    				<tr>
					    					<th></th>
					    					<th>序号</th>
					    					<th>企业法人姓名</th>
					    					<th>用户名</th>
					    					<th>审核状态</th>
					    					<th>创建时间</th>
					    					<th>操作</th>
					    				</tr>
					    			</thead>
					    			<tbody>
					    			<c:if test="${not empty qyrealList}">
											<c:forEach var="map" items="${qyrealList}" varStatus="idx">
								    			<tr>
													<td><input type="checkbox" class="table_box"></input></td>
													<td>${idx.index+1}</td>
													
													<td>${map.zname}</td>
													<td>${map.username}</td>
													<td>${map.status}</td>
													<td>${map.createTime}</td>
													<text name="id" value="${map.id }"></text>
													<td><a href="javascript:findCheckDetailQy('${map.id }')"><img src="images_c/checkout.png"/><span>审核</span></a></td>
													<%-- authentication/checkDetail?id=${map.id} --%>
												</tr>
											</c:forEach>
					    			</c:if>
					    			</tbody>
					    		</table>
					    	</div>
				    	</div>
				    	
				    	<!--弹窗-->
				    	<div class="background" id="bg" style="display: none;">
														<div class="tanchuang" style="width: 650px;">
								<div class="tanchuang_header">
					    				<div class="tanchuang_title">
											<img src="images_c/tanchuang_chaxun.png" />
											<p class="tanchuang_title_name">个人创客信息查询</p>
										</div>
										<img src="images_c/tanchuang_close.png" class="close"/>
								</div>
								<div class="tanchuang_line"></div>
								<div class="tanchuang_content">
									<form>
										<div class="form_group">
											<label class="tanchuang_label">用户名</label>
											<input type="text" id="zname" name="zname" class="tanchuang_input"/>
											<input type="text" id="qyid" name="qyid" class="tanchuang_input" hidden="true"/>
										</div>
										<div class="form_group">
											<label class="tanchuang_label">真实姓名</label>
											<input type="text" id="username" name="username" class="tanchuang_input"/>
										</div>
										<div class="form_group">
											<label class="tanchuang_label">联系地址</label>
											<input type="text" id="ctime" name="ctime" class="tanchuang_input"/>
										</div>
										<div class="form_group">
											<label class="tanchuang_label">证件类型</label>
											<input type="text" id="busnum" name="busnum" class="tanchuang_input"/>
										</div>
										<div class="form_group">
											<label class="tanchuang_label">证件号码</label>
											<input type="text" id="orgnum" name="orgnum" class="tanchuang_input"/>
										</div>
										<div class="form_group">
											<label class="tanchuang_label">证件照片</label>
											<div class="tanchuang_card">
												<div class="tanchuang_card_zheng"  id="yyzz999" name="yyzz999">
												<img id="zpicurls" style="width:200px;height:100px;" > 
												</div>
												<div class="tanchuang_card_zheng">
												<img id="fpicurls" style="width:200px;height:100px;" > 
												</div>
											</div>
										</div>
										<div class="form_group">
											<label class="tanchuang_label">证件合照照片</label>
											<div class="tanchuang_card" style="width: 40%;">
												<div class="tanchuang_card_zheng">
												<img id="ypicurls" style="width:200px;height:100px;" > 
												</div>
											</div>
										</div>
										<div class="form_group">
											<label class="tanchuang_label">处理反馈意见</label>
											<textarea class="text_view" id="feedback" name="feedback" value="feedback"></textarea>
										</div>
										<div class="form_group">
											<label class="tanchuang_label">处理状态</label>
											<input id="unrevised" type="radio" name="check" checked="checked" class="tanchu_radio" value="0"/>
											<span class="tanchu_status">未通过</span>
											<input id="rejective" type="radio" name="check" class="tanchu_radio" value="1"/>
											<span class="tanchu_status">打回</span>
											<input id="pass" type="radio" name="check" class="tanchu_radio" value="2"/>
											<span class="tanchu_status">通过</span>
										</div>
										<div class="form_group">
											<label class="tanchuang_label">&nbsp;</label>
											<div class="btn_group">
												<a class="tanchu_btn tanchu_btn_color1" href="javascript:submitQy()">提交</a>
												<a class="tanchu_btn tanchu_btn_color2">取消</a>
											</div>
										</div>
									</form>
								</div>
							</div>
						</div>
						<!--弹窗结束-->
						
						
			    	</div>
			    	
			    	
			    	
			    	
			    	<div class="tab_content" id="tab_content_person" style="display: none;">
			    		<form id="queryOptionsGr" enctype="multipart/form-data" action="authentication/infoCheck" method="POST">
			    		<div class="row search_block">
			    				<input type="text" id="type" name="type" value="gr" hidden="true"/>
			    			
			    				<label class="search_name">用户名</label>
			    				<input class="col-md-2 search_box" type="text" id="username" name="username" value="${authenticationBeanGr.username}"/>
			    				
			    				<label class="search_name">真实姓名</label>
			    				<input class="col-md-2 search_box" type="text" id="zname" name="zname" value="${authenticationBeanGr.zname}"/>
			    				
			    				<label class="search_name">审核状态</label>
			    				<select style="width:100px;" class="col-md-1 select_box" id="status" name="status"/>
									<option value="999" ${authenticationBeanGr.status == 999?'selected':''}>请选择</option>
									<option value="0" ${authenticationBeanGr.status == 0?'selected':''}>未审核</option>
									<option value="1" ${authenticationBeanGr.status == 1?'selected':''}>未通过</option>
									<option value="2" ${authenticationBeanGr.status == 2?'selected':''}>通过</option>
								</select>
			    				
			    				<div class="form_group">
									<label></label>
									<a class="search_btn" href="javascript:searchGr()">查询</a>
								</div>
					    	</div>
				    	<div class="row table_container">
				    		<div class="row search_result">
				    			<div class="search_result_left">
				    				<div class="search_result_icon"></div>
				    			    <p class="search_result_label">查询结果</p>
				    			</div>
				    			<div class="search_result_right">
				    				<img src="images_c/icon1.png" />
				    				<span>审核通过</span>
				    				<img src="images_c/icon2.png" />
				    				<span>审核不通过</span>
				    				<img src="images_c/icon3.png" />
				    				<span>启用</span>
				    				<img src="images_c/icon4.png" />
				    				<span>停用</span>
				    			</div>
				    		</div>
				    		<div class="table_block">
					    		<table class="table table-center table-striped table-bordered table-hover"
								cellspacing="0" width="100%">
					    			<thead>
					    				<tr>
					    					<th></th>
					    					<th>序号</th>
					    					<th>用户名</th>
					    					<th>真实姓名</th>
					    					<th>审核状态</th>
					    					<th>更新时间</th>
					    					<th>操作</th>
					    				</tr>
					    			</thead>
					    			<tbody>
					    			<c:if test="${not empty grrealList}">
											<c:forEach var="map" items="${grrealList}" varStatus="idx">
								    			<tr>
													<td><input type="checkbox" class="table_box"></input></td>
													<td>${idx.index+1}</td>
													
													<td>${map.zname}</td>
													<td>${map.username}</td>
													<td>${map.status}</td>
													<td>${map.createTime}</td>
													<text name="id" value="${map.id }"></text>
													<td><a href="javascript:findCheckDetailGr('${map.id }')"><img src="images_c/checkout.png"/><span>审核</span></a></td>
												</tr>
											</c:forEach>
					    			</c:if>
					    			</tbody>
					    		</table>
					    	</div>
				    	</div>
				    	
				    	<!--弹窗-->
				    	<div class="background" id="bg" style="display: none;">
							<div class="tanchuang" style="width: 650px; height: 600px">
																<div class="tanchuang_header">
				    				<div class="tanchuang_title">
										<img src="images_c/tanchuang_chaxun.png" />
										<p class="tanchuang_title_name">个人创客信息查询</p>
									</div>
									<img src="images_c/tanchuang_close.png" class="close"/>
								</div>
								<div class="tanchuang_line"></div>
								<div class="tanchuang_content">
									<form>
										<div class="form_group">
											<label class="tanchuang_label">用户名</label>
											<input type="text" id="grzname" name="grzname" class="tanchuang_input"/>
											<input type="text" id="grid" name="grid" class="tanchuang_input" hidden="true"/>
										</div>
										<div class="form_group">
											<label class="tanchuang_label">真实姓名</label>
											<input type="text" id="grusername" name="grusername" class="tanchuang_input"/>
										</div>
										<div class="form_group">
											<label class="tanchuang_label">联系地址</label>
											<input type="text" id="linkadd" name="linkadd" class="tanchuang_input"/>
										</div>
										<div class="form_group">
											<label class="tanchuang_label">证件类型</label>
											<input type="text" id="crtype" name=""crtype"" class="tanchuang_input"/>
										</div>
										<div class="form_group">
											<label class="tanchuang_label">证件号码</label>
											<input type="text" id="crnum" name="crnum" class="tanchuang_input"/>
										</div>
										<div class="form_group">
											<label class="tanchuang_label">法人证件照片</label>
											<div class="tanchuang_card">
												<div class="tanchuang_card_zheng"  id="yyzz999" name="yyzz999">
												<img id="grzpicurls" style="width:200px;height:100px;" > 
												</div>
												<div class="tanchuang_card_zheng">
												<img id="grfpicurls" style="width:200px;height:100px;" > 
												</div>
											</div>
										</div>
										<div class="form_group">
											<label class="tanchuang_label">证件合照照片</label>
											<div class="tanchuang_card" style="width: 40%;">
												<div class="tanchuang_card_zheng">
												<img id="rpicurls" style="width:200px;height:100px;" > 
												</div>
											</div>
										</div>
										<div class="form_group">
											<label class="tanchuang_label">处理反馈意见</label>
											<textarea class="text_view" id="grfeedback" name="grfeedback" value="grfeedback"></textarea>
										</div>
										<div class="form_group">
											<label class="tanchuang_label">处理状态</label>
											<input id="unrevised" type="radio" name="grcheck" checked="checked" class="tanchu_radio" value="0"/>
											<span class="tanchu_status">未通过</span>
											<input id="rejective" type="radio" name="grcheck" class="tanchu_radio" value="1"/>
											<span class="tanchu_status">打回</span>
											<input id="pass" type="radio" name="grcheck" class="tanchu_radio" value="2"/>
											<span class="tanchu_status">通过</span>
										</div>
										<div class="form_group">
											<label class="tanchuang_label">&nbsp;</label>
											<div class="btn_group">
												<a class="tanchu_btn tanchu_btn_color1" href="javascript:submitGr()">提交2</a>
												<a class="tanchu_btn tanchu_btn_color2">取消</a>
											</div>
										</div>
									</form>
								</div>
							</div>
						</div>
						<!--弹窗结束-->
						
						
						
			    	</div>
			    </div>
		    </div>
		</div>
		

		<div id="doing"></div> 
 
	<script>
		$(document).ready(function(){
			var type = '<%=request.getSession().getAttribute("type")%>'; //type---> qy企业，gr个人
			if(type == 'gr'){
				tab1.style.display = "none";				
				tab2.style.display = "";
				$(this).addClass('active_li');
				$(this).siblings().removeClass('active_li');
				var num=$(this).index();
				$('.tab_content').hide();
				$('.tab_content').eq(num).show();
			}else{
				tab1.style.display = "";				
				tab2.style.display = "none";	
			}
			var flg = true;
			$(".tab_block>li").click(function(){
				$(this).addClass('active_li');
				$(this).siblings().removeClass('active_li');
				var num=$(this).index();
				$('.tab_content').hide();
				$('.tab_content').eq(num).show();
			});
			$(".shenhe").click(function(){
				$(".background").fadeIn();
			});
			/*$("#close").click(function(){
				$(".background").fadeOut();
//				$("this").parents('.background').fadeOut();
			});*/
			$('.close').click(function() {
				$('.background').fadeOut();
			})
			$(".tanchuang_card_zheng").click(function(){
				var imgH=$(this).height();
				var imgW=$(this).width();
				if(flg){
					$(this).height(imgH*2);
					$(this).width(imgW*2);
				}else{
					$(this).height(imgH/2);
					$(this).width(imgW/2);
				}
				flg = !flg;
			});
		})
		
		function findCheckDetailQy(id){
			var data = {"id":id,"type":'qy'};
			$.ajax({
				cache: true,
                type: "POST",
                url:"authentication/checkDetail",
                data:data,
                async: false,
                success: function(data) {
                	var result = eval("("+data+")");
                	
               	 	$("#qyid").val(result.id);
               	 	$("#username").val(result.username);
               	 	$("#zname").val(result.zname);
               	 	$("#ctime").val(result.ctime);
               	 	$("#busnum").val(result.busnum);
               	 	$("#orgnum").val(result.orgnum);
               		
               		$("#zpicurls").attr('src',"http://localhost:8089/"+result.zpicurl); 
               		$("#fpicurls").attr('src',"http://localhost:8089/"+result.fpicurl); 
               		$("#ypicurls").attr('src',"http://localhost:8089/"+result.ypicurl); 
                	$(".background").fadeIn();
                }
			})
		}	
		
		function findCheckDetailGr(id){
			var data = {"id":id,"type":'gr'};
			$.ajax({
				cache: true,
                type: "POST",
                url:"authentication/checkDetail",
                data:data,
                async: false,
                success: function(data) {
                	var result = eval("("+data+")");
                	
               	 	$("#grid").val(result.id);
               	 	$("#grusername").val(result.username);
               	 	$("#grzname").val(result.zname);
               	 	$("#linkadd").val(result.linkadd);
               	 	$("#crtype").val(result.crtype);
               	 	$("#crnum").val(result.crnum);
               		
               		$("#grzpicurls").attr('src',"http://localhost:8089/"+result.zpicurl); 
               		$("#grfpicurls").attr('src',"http://localhost:8089/"+result.fpicurl); 
               		$("#rpicurls").attr('src',"http://localhost:8089/"+result.rpicurl); 
                	$(".background").fadeIn();
                }
			})
		}	
		
		function submitQy(){
			
			var status = $("input[name='check']:checked").val();
			var feedback = $("#feedback").val();
			var id = $("#qyid").val();
			
			var data = {
					"status":status,
					"feedback":feedback,
					"id":id,
					"type":'qy'
					};
			$.ajax({
				cache: true,
                type: "POST",
                url:"authentication/updateCheckInfo",
                data:data,
                async: false,
                success: function(data) {
                	alert("操作成功！");
                	
                	location.href = "authentication/infoCheck"
                }
			})
		}
		
			function submitGr(){
			var status = $("input[name='grcheck']:checked").val();
			var feedback = $("#grfeedback").val();
			var id = $("#grid").val();
			
			var data = {
					"status":status,
					"feedback":feedback,
					"id":id,
					"type":'gr'
					};
			$.ajax({
				cache: true,
                type: "POST",
                url:"authentication/updateCheckInfo",
                data:data,
                async: false,
                success: function(data) {
                	alert("操作成功！");
                	
                	location.href = "authentication/infoCheck?type=gr"
                }
			})
		}
		
		function submit() 
		{ 
		    var form = document.getElementById('queryOptionsQy');
		    form.submit();
		    alert("操作成功！");
		}	
		
		function searchGr() 
		{ 
		    var form = document.getElementById('queryOptionsGr');
		    form.submit();
		    alert("操作成功！");
		}	
		
	</script>
</html>
